package com.superb.system.api.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.superb.common.core.annotation.SuperbEncryptDecrypt;
import com.superb.common.core.annotation.SuperbEncryptDecryptField;
import com.superb.common.core.enums.EncryptType;
import com.superb.common.database.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * 系统用户表
 * @Author: ajie
 * @CreateTime: 2024-5-7
 */
@Data
@SuperbEncryptDecrypt
@Schema(title = "系统用户表")
@EqualsAndHashCode(callSuper=false)
public class SystemUser extends BaseEntity {

    @NotBlank(message = "用户名不能为空")
    @Schema(title = "用户名", description = "用于登录的名称", requiredMode = Schema.RequiredMode.REQUIRED)
    private String username;

    @Schema(description = "登录密码", requiredMode = Schema.RequiredMode.REQUIRED)
    private String password;

    @Schema(description = "用户随机盐")
    private String salt;

    @Schema(description = "昵称")
    private String nickname;

    @Schema(description = "电话号码")
    @SuperbEncryptDecryptField(type = EncryptType.PHONE)
    private String phoneNumber;

    @Schema(description = "电子邮箱")
    @SuperbEncryptDecryptField(encrypt = false, type = EncryptType.EMAIL)
    private String email;

    @Schema(description = "身份证号")
    @SuperbEncryptDecryptField(type = EncryptType.IDCARD)
    private String idcard;

    @Schema(description = "头像")
    private String avatar;

    @Schema(title = "性别", description = "0男；1女")
    private Integer sex;

    @Schema(title = "是否认证", description = "0否；1是(是否实名)")
    private Integer authentication;

    @Schema(title = "状态", description = "0启用；1禁用")
    private Integer status;

    @Schema(title = "租户管理员", description = "0否；1是")
    private Integer superb;

}